/*
 *--------------------------------------------------------------------------
 *   Battlefield - A Realtime Network Multiplayer Game
 *   =======================================================
 *   Developed by Group D02 - 2009/2010 Semester 4 - CS2103
 *     Harry Nguyen Duy Hoang <nnduyhoang@yahoo.co.uk>
 *     Kent Chng Siang Rong <fivefootway@gmail.com>
 *     Lim Yong Peng <limpeng1986@gmail.com>
 *     Loh Xiankun <u0807185@nus.edu.sg>
 *   Instructed by
 *     Dr. Damith C.Rajapakse <damith@gmail.com>
 *   =======================================================
 *   $Id: BattlefieldServerInterface.java 647 2010-07-30 06:29:49Z Harry $
 *   $LastChangedDate: 2010-07-30 06:29:49 +0000 (Fri, 30 Jul 2010) $
 *   $LastChangedBy: Harry $
 *--------------------------------------------------------------------------
 */
package battlefield;

import battlefield.entity.Game;
import battlefield.entity.Map;
import battlefield.entity.Player;
import battlefield.entity.Unit;
import battlefield.entity.UnitModel;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.List;

/**
 *
 * @author Yong Peng, Kent, Harry Nguyen
 */
public interface BattlefieldServerInterface extends Remote {

    public Player getPlayer(int playerId) throws RemoteException;

    public boolean isAlive(int playerId) throws RemoteException;

    public Player getOpponent(int playerId) throws RemoteException;

    public boolean isHost(int playerId) throws RemoteException;

    public List<Game> getGames() throws RemoteException;

    public Game getGame(int gameId) throws RemoteException;

    public Game getCurrentGame(int playerId) throws RemoteException;

    public Game createGame(int playerId) throws RemoteException;

    public void joinGame(int playerId, int gameId) throws RemoteException;

    public void computerJoinGame(int playerId, int gameId, int difficultyLevel) throws RemoteException;

    public void setGameSettings(int gameId, int turnDuration, int numberOfWeapons, int numberOfEquipment) throws RemoteException;

    public String[] getMapNames() throws RemoteException;

    public Map createMap(int playerId, String name) throws RemoteException;

    public void buyAndPlaceUnitOnMap(int playerId, int modelId, int x, int y) throws RemoteException;

    public boolean buyAndUseWeaponOnMap(int playerId, int opponentPlayerId, int modelId, int x, int y) throws RemoteException;

    public void sellUnitOnMap(int playerId, int x, int y) throws RemoteException;

    public Unit getUnitOnMap(int playerId, int x, int y) throws RemoteException;

    public void endTacticalPhase(int playerId) throws RemoteException;

    public void beginWarPhase(int playerId) throws RemoteException;

    public void topupGold(int playerId, int reloadQty) throws RemoteException;

    public void updateUnitCounts(int playerId) throws RemoteException;

    public Player registerPlayer() throws RemoteException;

    public void changePlayerName(int playerId, String name) throws RemoteException;

    public boolean isOpponentJoin(int playerId) throws RemoteException;

    public List<UnitModel> getUnitModels() throws RemoteException;

    public int doMission(int playerId, String missionName) throws RemoteException;

    public void createMissions(int playerId) throws RemoteException, BattlefieldException;
}
